import math

class Visualizer:
    def renderLine(self, v1, v2): pass

    def renderSphere(self, pos, r): pass

    def invertSphere(self, v):
        return (v / (4.0 / 3.0 * math.pi)) ** (1.0/3.0)

    def renderWorld(self, world):
        for body in world.bodies:
            for spring in body.springs:
                self.renderLine(spring.fromPoint.pos,spring.toPoint.pos)

            for pm in body.pointMasses:
                self.renderSphere(pm.pos,self.invertSphere(pm.mass))
